﻿#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
void Myprint(int val)
{
	cout << val << "  ";
}
void test01()
{
	vector<int>v;
	for (int i = 0; i < 10; i++)
	{
		v.push_back(i);
	}
	for_each(v.begin(), v.end(), Myprint);
	cout << endl;
	reverse(v.begin(), v.end());  //反转
	for_each(v.begin(), v.end(), Myprint);
	cout << endl;
}
int main()
{
	test01();
}